var PIMS = PIMS || {} ;
PIMS.menu = (function () {
    var setting ={
        menuGrid:$('#tableList'),
        menuListUrl:baseUrl + '/system/menu/getList'
    };
    var private = {
        initGrid:function () {
            setting.menuGrid.jqGrid({
                url: setting.menuListUrl,
                mtype: "GET",
                datatype: "json",
                colNames: ['资源权限ID', '资源权限名字', '上级资源权限ID', '权限字符串', '资源权限类型', '资源权限URL', '状态','备注'],
                colModel: [
                    {name: 'id', index: 'id', width: 80, hidden: true},
                    {name: 'name', index: 'name', width: 100},
                    {name: 'parentId', index: 'parentId', width: 80},
                    {name: 'permission', index: 'permission', width: 80},
                    {name: 'type', index: 'type', width: 60},
                    {name: 'url', index: 'url', width: 60},
                    {name: 'remarks', index: 'remarks', width: 60}
                ],
                loadComplete: function () {

                },
                ondblClickRow: function (id) {

                },
                beforeSelectRow: function (rowid, e) {
                    return $(e.target).is('input[type=checkbox]');
                },
                loadComplete: function () {
                    var table = this;
                    setTimeout(function () {
                        updatePagerIcons(table);
                    }, 0);

                },
                multiselect: true,
                viewrecords: true,
                shrinkToFit: true,
                repeatitems: false,
                rownumbers: true, // 显示行号
                rownumWidth: 35,
                pager: "#pager",//分页控件
            });
        }
    };
    var public ={
        init:function () {
            private.initGrid();
        }
    };
    return public;
})();

$(function () {
    PIMS.menu.init();
})